package com.vincent.message;

import com.vincent.common.Message;
import com.vincent.common.MessageType;
import com.vincent.utils.BallotNumber;
import com.vincent.utils.PValueSet;

/**
 * Created by wensen on 2016/12/7.
 *
 *  Sent by Acceptors to Scouts in Phase 1 of Paxos.
 *  Carries a ballot number and the set of accepted pvalues.
 *
 **/
public class P1bMessage extends Message{

    private final BallotNumber ballot_number;
    private final PValueSet accepted;
    public P1bMessage(int src, BallotNumber ballot_number, PValueSet accepted) {
        super(src);
        this.ballot_number = ballot_number;
        this.accepted = accepted;
    }

    public BallotNumber ballot_number() {
        return this.ballot_number;
    }

    public PValueSet accepted() {
        return this.accepted;
    }

    public int messageType() {
        return MessageType.P1B_MESSAGE;
    }
}
